/**
 * 用户授权日志 Model
 * @authors 杨兴洲（of2502）
 * @date    2017/3/28 19:10
 * @version 1.0
 */

import {model, Schema} from "mongoose";

const LogSchema = new Schema({
    userID: {"type": String, "required": true},
    appID: {"type": String, "required": true},
    actionType: {
        "type": String, "required": true,
        "enum": ["authorized", "unauthorized", "updateauthorized"]
    },
}, {timestamps: true});

LogSchema.index({userID: 1, appID: 1, actionType: 1});

export default model('Log', LogSchema);
